<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
<link rel="stylesheet" type="text/css"
	href="/bootstrap/bootstrap.4.1.0.css">
<script src="/bootstrap/jquery.3.2.1.min.js"></script>
<script src="/bootstrap/popper.12.5.min.js"></script>
<script src="/bootstrap/bootstrap.4.1.0.min.js"></script>
<script src="/layui/layer/layer.js"></script>
<script src="/vue/Vue.js"></script>
<script src="/vue/axios.js"></script>
</head>
<body>
<div class="container">
    <div class="row clearfix">

        <div id="buttons" class="col-md-8 column col-lg-offset-2">
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <button type="button" class="btn btn-lg btn-info btn-block" @click="student">我是学员</button>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <button type="button" class="btn btn-lg btn-info btn-block" @click="coach">我是教练</button>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <button type="button" class="btn btn-info btn-lg btn-block" @click="gym">场馆认证</button>
        </div>
    </div>
</div>
<script>
    var myBtn = new Vue({
        el: "#buttons",
        data: {},
        methods: {
            student() {
//                 axios.get("/attest/getPage", {
//                     params: {
//                         pageNum: 1
//                     }
//                 }).then(function (result) {
//                     console.info(result.data);
//                     location.href = result.data;
//                 })
				axios.get("/user/setRole?role=1").then(
                	res => {
                		if(res.data.code==1){
                			layer.confirm('您要前往完善资料吗？', {
                      		  btn: ['是的','不了'] //按钮
                      		}, function(){
                      		 location.href="/lsw/detail.html";
                      		}, function(){
                      		  location.href="/zlz/main.html"
                      		});
                		}else{
                			layer.alert("系统繁忙，请稍后再试!")
                		}
                	}
                );
            },
            coach() {
                axios.get("/user/setRole?role=2").then(
                	res => {
                		if(res.data.code==1){
                			location.href="/lsw/detail.html";
                		}else{
                			layer.alert("系统繁忙，请稍后再试!")
                		}
                	}
                );
            },
            gym() {
            	axios.get("/user/setRole?role=3").then(
                    	res => {
                    		if(res.data.code==1){
                                location.href = "/cyh/detail.html";
                            }else{
                    			layer.alert("系统繁忙，请稍后再试!")
                    		}
                    	}
                    );
            }
        }
    })

</script>
<script src="../js/bootstrap3.3.7.js"></script>
</body>
</html>